home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_libgtop.idb / usr / freeware / include / glibtop / netload.h.z / netload.h
Encoding:
C/C++ Source or Header  |  1999-07-16  |  3.7 KB  |  121 lines

  1. /* $Id: netload.h,v 1.7 1999/02/23 11:42:59 martin Exp $ */
  2.  
  3. /* Copyright (C) 1998-99 Martin Baulig
  4.    This file is part of LibGTop 1.0.
  5.  
  6.    Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
  7.  
  8.    LibGTop is free software; you can redistribute it and/or modify it
  9.    under the terms of the GNU General Public License as published by
  10.    the Free Software Foundation; either version 2 of the License,
  11.    or (at your option) any later version.
  12.  
  13.    LibGTop is distributed in the hope that it will be useful, but WITHOUT
  14.    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15.    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  16.    for more details.
  17.  
  18.    You should have received a copy of the GNU General Public License
  19.    along with LibGTop; see the file COPYING. If not, write to the
  20.    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21.    Boston, MA 02111-1307, USA.
  22. */
  23.  
  24. #ifndef __GLIBTOP_NETLOAD_H__
  25. #define __GLIBTOP_NETLOAD_H__
  26.  
  27. #include <glibtop.h>
  28. #include <glibtop/global.h>
  29.  
  30. BEGIN_LIBGTOP_DECLS
  31.  
  32. #define GLIBTOP_NETLOAD_IF_FLAGS    0
  33. #define GLIBTOP_NETLOAD_MTU        1
  34. #define GLIBTOP_NETLOAD_SUBNET        2
  35. #define GLIBTOP_NETLOAD_ADDRESS        3
  36. #define GLIBTOP_NETLOAD_PACKETS_IN    4
  37. #define GLIBTOP_NETLOAD_PACKETS_OUT    5
  38. #define GLIBTOP_NETLOAD_PACKETS_TOTAL    6
  39. #define GLIBTOP_NETLOAD_BYTES_IN    7
  40. #define GLIBTOP_NETLOAD_BYTES_OUT    8
  41. #define GLIBTOP_NETLOAD_BYTES_TOTAL    9
  42. #define GLIBTOP_NETLOAD_ERRORS_IN    10
  43. #define GLIBTOP_NETLOAD_ERRORS_OUT    11
  44. #define GLIBTOP_NETLOAD_ERRORS_TOTAL    12
  45. #define GLIBTOP_NETLOAD_COLLISIONS    13
  46.  
  47. #define GLIBTOP_MAX_NETLOAD        14
  48.  
  49. typedef struct _glibtop_netload    glibtop_netload;
  50.  
  51. enum {
  52.     GLIBTOP_IF_FLAGS_UP = 1,
  53.     GLIBTOP_IF_FLAGS_BROADCAST,
  54.     GLIBTOP_IF_FLAGS_DEBUG,
  55.     GLIBTOP_IF_FLAGS_LOOPBACK,
  56.     GLIBTOP_IF_FLAGS_POINTOPOINT,
  57.     GLIBTOP_IF_FLAGS_RUNNING,
  58.     GLIBTOP_IF_FLAGS_NOARP,
  59.     GLIBTOP_IF_FLAGS_PROMISC,
  60.     GLIBTOP_IF_FLAGS_ALLMULTI,
  61.     GLIBTOP_IF_FLAGS_OACTIVE,
  62.     GLIBTOP_IF_FLAGS_SIMPLEX,
  63.     GLIBTOP_IF_FLAGS_LINK0,
  64.     GLIBTOP_IF_FLAGS_LINK1,
  65.     GLIBTOP_IF_FLAGS_LINK2,
  66.     GLIBTOP_IF_FLAGS_ALTPHYS,
  67.     GLIBTOP_IF_FLAGS_MULTICAST
  68. };
  69.  
  70. struct _glibtop_netload
  71. {
  72.     u_int64_t    flags,
  73.         if_flags,        /* GLIBTOP_NETLOAD_IF_FLAGS    */
  74.         mtu,            /* GLIBTOP_NETLOAD_MTU        */
  75.         subnet,            /* GLIBTOP_NETLOAD_SUBNET    */
  76.         address,        /* GLIBTOP_NETLOAD_ADDRESS    */
  77.         packets_in,        /* GLIBTOP_NETLOAD_PACKETS_IN    */
  78.         packets_out,        /* GLIBTOP_NETLOAD_PACKETS_OUT    */
  79.         packets_total,        /* GLIBTOP_NETLOAD_PACKETS_TOTAL*/
  80.         bytes_in,        /* GLIBTOP_NETLOAD_BYTES_IN    */
  81.         bytes_out,        /* GLIBTOP_NETLOAD_BYTES_OUT    */
  82.         bytes_total,        /* GLIBTOP_NETLOAD_BYTES_TOTAL    */
  83.         errors_in,        /* GLIBTOP_NETLOAD_ERRORS_IN    */
  84.         errors_out,        /* GLIBTOP_NETLOAD_ERRORS_OUT    */
  85.         errors_total,        /* GLIBTOP_NETLOAD_ERRORS_TOTAL    */
  86.         collisions;        /* GLIBTOP_NETLOAD_COLLISIONS    */
  87. };
  88.  
  89. #define glibtop_get_netload(netload,interface)    glibtop_get_netload_l(glibtop_global_server, netload, interface)
  90.  
  91. #if GLIBTOP_SUID_NETLOAD
  92. #define glibtop_get_netload_r    glibtop_get_netload_p
  93. #else
  94. #define glibtop_get_netload_r    glibtop_get_netload_s
  95. #endif
  96.  
  97. void glibtop_get_netload_l (glibtop *server, glibtop_netload *buf, const char *interface);
  98.  
  99. #if GLIBTOP_SUID_NETLOAD
  100. void glibtop_init_netload_p (glibtop *server);
  101. void glibtop_get_netload_p (glibtop *server, glibtop_netload *buf, const char *interface);
  102. #else
  103. void glibtop_init_netload_s (glibtop *server);
  104. void glibtop_get_netload_s (glibtop *server, glibtop_netload *buf, const char *interface);
  105. #endif
  106.  
  107. #ifdef GLIBTOP_NAMES
  108.  
  109. /* You need to link with -lgtop_names to get this stuff here. */
  110.  
  111. extern const char *glibtop_names_netload [];
  112. extern const unsigned glibtop_types_netload [];
  113. extern const char *glibtop_labels_netload [];
  114. extern const char *glibtop_descriptions_netload [];
  115.  
  116. #endif
  117.  
  118. END_LIBGTOP_DECLS
  119.  
  120. #endif
  121.